Skip to content

fix(darwin): escape special XML characters in Info.plist template values#5230

Draft
leaanthony wants to merge 1 commit into
masterfrom
fix/4865-ampersand-plist
Draft

fix(darwin): escape special XML characters in Info.plist template values#5230
leaanthony wants to merge 1 commit into
masterfrom
fix/4865-ampersand-plist

Conversation

@leaanthony

Copy link
Copy Markdown
Member

Summary

  • Adds an xmlEscape template function that uses Go's html/template escaping
  • Applies {{xml .Value}} to all user-facing values in Info.plist and Info.dev.plist templates
  • Characters like &, <, > in wails.json fields (e.g. copyright) now produce valid XML

Test

  • v2/pkg/buildassets/xml_escape_test.go — verifies ampersand, angle bracket, and quote escaping
  • TestResolveProjectDataEscapesAmpersand — end-to-end test with a plist-like template

Fixes #4865

The plist templates used text/template with raw value interpolation,
so characters like & in wails.json fields (e.g. copyright) produced
invalid XML in the generated Info.plist, breaking macOS packaging.

Add an xmlEscape helper function and use it via the {{xml}} template
func in both Info.plist and Info.dev.plist templates.

Fixes #4865
@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5ad0b811-dccc-44c2-aedb-24b6bf5b827f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/4865-ampersand-plist

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@leaanthony

Copy link
Copy Markdown
Member Author

🤖 PR Triage Review

Accepted

Escapes special XML characters in Info.plist template values. Prevents XML injection issues.

Platform: macOS (v2-only)

Next Steps: Dispatching for Mac testing.


Reviewed by Wails PR Reviewer Bot

@leaanthony leaanthony added this to the v2.13.0 milestone May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ampersand in wails.json breaks macOS packaging

1 participant